package com.imti.mall.product.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.imti.mall.model.pms.pojo.PmsMemberPrice;
import com.imti.mall.product.mapper.PmsMemberPriceDynaSqlProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

@Mapper
public interface PmsMemberPriceDao extends BaseMapper<PmsMemberPrice> {
    /**
     * 根据商品id查询会员价
     * @param id
     * @return
     */
    @Select("select id,product_id,member_level_id,member_price,member_level_name from pms_member_price where product_id=#{id}")
    public List<PmsMemberPrice> getPmsMemberPriceId(Integer id);

    /**
     * 根据表id修改会员价格表
     * @param pmsMemberPrice
     * @return
     */
    @UpdateProvider(type= PmsMemberPriceDynaSqlProvider.class, method = "updatePmsMemberPrice")
    public Integer updatePmsMemberPrice(PmsMemberPrice pmsMemberPrice);
}
